home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / dev / lang / fpc09905c.lha / fpc / units / makefile < prev    next >
Makefile  |  1998-09-21  |  5KB  |  230 lines

  1. #
  2. #   $Id: makefile,v 1.1 1998/06/04 23:45:56 peter Exp $
  3. #   This file is part of the Free Pascal run time library.
  4. #   Copyright (c) 1996-98 by Michael van Canneyt
  5. #
  6. #   Makefile for the Free Pascal Amiga Runtime Library
  7. #
  8. #   See the file COPYING.FPC, included in this distribution,
  9. #   for details about the copyright.
  10. #
  11. #   This program is distributed in the hope that it will be useful,
  12. #   but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. #
  15.  
  16. #####################################################################
  17. # Start of configurable section.
  18. # Please note that all these must be set in the main makefile, and
  19. # should be set there.
  20. # Don't remove the indef statements. They serve to avoid conflicts
  21. # with the main makefile.
  22. #####################################################################
  23.  
  24. # What is the Operating System ?
  25. ifndef OS_SOURCE
  26. OS_SOURCE=linux
  27. endif
  28.  
  29. # What is the target operating system ?
  30. ifndef OS_TARGET
  31. OS_TARGET=amiga
  32. endif
  33.  
  34. # What is the target processor :
  35. ifndef CPU
  36. #CPU=i386
  37. CPU=m68k
  38. endif
  39.  
  40. # What compiler to use ?
  41. ifndef PP
  42. PP=ppc68k
  43. endif
  44.  
  45. # What options to pass to the compiler ?
  46. # You may want to specify a config file or error definitions file here.
  47. ifndef OPT
  48. OPT=
  49. endif
  50.  
  51. # Where is the PPUMOVE program ?
  52. ifndef PPUMOVE
  53. PPUMOVE=ppumove
  54. endif
  55.  
  56. # Set this to 'shared' or 'static'
  57. LIBTYPE=shared
  58.  
  59. # AOUT should be defined in main makefile.
  60. # But you can set it here too.
  61. # AOUT = -DAOUT
  62.  
  63. # Do you want to link to the C library ?
  64. # Standard it is NO. You can set it to YES to link in th C library.
  65. ifndef LINK_TO_C
  66. LINK_TO_C=NO
  67. endif
  68.  
  69. #####################################################################
  70. # End of configurable section.
  71. # Do not edit after this line.
  72. #####################################################################
  73.  
  74. #####################################################################
  75. # System independent
  76. #####################################################################
  77.  
  78. # Where are the include files ?
  79. INC=../inc
  80. PROCINC=../$(CPU)
  81. CFG=../cfg
  82. OBJPASDIR=../objpas
  83.  
  84. # Get some defaults for Programs and OSes.
  85. # This will set the following variables :
  86. # inlinux indos COPY REPLACE DEL INSTALL INSTALLEXE MKDIR
  87. # It will also set OPT for cross-compilation, and add required options.
  88. # also checks for config file.
  89. # it expects INC PROCINC to be set !!
  90. include $(CFG)/makefile.cfg
  91.  
  92. # Get the system independent include file names.
  93. # This will set the following variables : 
  94. # SYSINCNAMES
  95. include $(INC)/makefile.inc
  96. SYSINCDEPS=$(addprefix $(INC)/,$(SYSINCNAMES))
  97.  
  98. # Get the processor dependent include file names.
  99. # This will set the following variables : 
  100. # CPUINCNAMES
  101. include $(PROCINC)/makefile.cpu
  102. SYSCPUDEPS=$(addprefix $(PROCINC)/,$(CPUINCNAMES))
  103.  
  104. # Put system unit dependencies together.
  105. SYSDEPS=$(SYSINCDEPS) $(SYSCPUDEPS)
  106.  
  107. #####################################################################
  108. # System dependent
  109. #####################################################################
  110.  
  111. # Check if we need C library.
  112. ifeq ($(LINK_TO_C),YES)
  113. override OPT:=$(OPT) -dCRTLIB
  114. endif
  115.  
  116. # Define Linux Units
  117. SYSTEMPPU=sysamiga$(PPUEXT)
  118. OBJECTS=strings
  119.  
  120. PRT=prt0
  121. LOADERAS=$(PRT).as
  122.  
  123. # Define Loaders
  124. ifeq ($(LINK_TO_C),NO)
  125. LOADERS=prt0
  126. else
  127. LOADERS=lprt
  128. endif
  129.  
  130. # Add Prefix and Suffixes
  131. OBJLOADERS=$(addsuffix $(OEXT), $(LOADERS))
  132. PPUOBJECTS=$(addsuffix $(PPUEXT), $(OBJECTS))
  133.  
  134. .PHONY : all install clean \
  135.      libs libsclean \
  136.      diffs diffclean \
  137.  
  138. all : $(OBJLOADERS) $(PPUOBJECTS)
  139.  
  140. install : all
  141.     $(MKDIR) $(UNITINSTALLDIR)
  142.     $(INSTALL) *$(PPUEXT) *$(OEXT) $(UNITINSTALLDIR)
  143.  
  144. clean :
  145.     -$(DEL) *$(OEXT) *$(ASMEXT) *$(PPUEXT) *.PPS log
  146.  
  147. #####################################################################
  148. # Files
  149. #####################################################################
  150.  
  151. #
  152. # Loaders
  153. #
  154.  
  155. prt0$(OEXT) : $(LOADERAS)
  156.     -as $(LOADERAS) -o prt0$(OEXT)
  157.  
  158. #gprt0$(OEXT) : $(GLOADERAS)
  159. #    -as $(GLOADERAS) -o gprt0$(OEXT)
  160.  
  161. #
  162. # Base Units (System, strings, os-dependent-base-unit)
  163. #
  164.  
  165. $(SYSTEMPPU) : sysamiga.pas $(SYSLINUXDEPS) $(SYSDEPS)
  166.     $(PP) $(OPT) -Us -Sg sysamiga.pas $(REDIR)
  167.  
  168. strings$(PPUEXT) : $(PROCINC)/strings.pp $(SYSTEMPPU)
  169.     $(COPY) $(PROCINC)/strings.pp .
  170.     $(PP) $(OPT) strings $(REDIR)
  171.     $(DEL) strings.pp
  172.  
  173. #
  174. # Delphi Object Model
  175. #
  176.  
  177. objpas$(PPUEXT) : $(OBJPASDIR)/objpas.pp $(SYSTEMPPU)
  178.     $(COPY) $(OBJPASDIR)/objpas.pp .
  179.     $(PP) $(OPT) objpas $(REDIR)
  180.     $(DEL) objpas.pp
  181.  
  182. #
  183. # System Dependent Units
  184. #
  185.  
  186. #
  187. # TP7 Compatible RTL Units
  188. #
  189.  
  190. #dos$(PPUEXT) : $(DOSDEPS) $(SYSTEMPPU)
  191. #    $(PP) $(OPT) dos $(REDIR)
  192.  
  193. crt$(PPUEXT) : crt.pp $(INC)/textrec.inc $(INC)/filerec.inc $(SYSTEMPPU)
  194.     $(PP) $(OPT) crt $(REDIR)
  195.  
  196. objects$(PPUEXT) : $(INC)/objects.pp objinc.inc $(SYSTEMPPU)
  197.     $(COPY) $(INC)/objects.pp .
  198.     $(PP) $(OPT) objects $(REDIR)
  199.     $(DEL) objects.pp
  200.  
  201. #
  202. # Other RTL Units
  203. #
  204.  
  205. #####################################################################
  206. # Libs
  207. #####################################################################
  208.  
  209. libs    : all libfpc$(LIBEXT)
  210.  
  211. libfpc.so:
  212.     $(PPUMOVE) -o fpc *.ppu
  213.  
  214. libfpc.a:
  215.     $(PPUMOVE) -s -o fpc *.ppu
  216.  
  217. libinstall : libs
  218.     $(INSTALLEXE) libfpc$(LIBEXT) $(LIBINSTALLDIR)
  219.     $(INSTALL) *$(PPLEXT) $(UNITINSTALLDIR)
  220.     ldconfig
  221.     
  222. libsclean : clean
  223.     -$(DEL) *.a *.so *$(PPLEXT)
  224.  
  225. #####################################################################
  226. # Default targets
  227. #####################################################################
  228.  
  229. include $(CFG)/makefile.def
  230.